#include <iostream>

template<typename T1,typename T2>
class TemplateClass
{
public:
    TemplateClass(T1 a,T2 b):a(a),b(b){}
    void show()
    {
        std::cout<<"模板class"<<std::endl;
        std::cout<<a<<" "<<b<<std::endl;
    }
private:
    T1 a;
    T2 b;
};

//类模板的全特化
template <> 
class TemplateClass<int,double>
{
public:
    TemplateClass(int a,double b):a(a),b(b){}

    void show()
    {
        std::cout<<"全特化class"<<std::endl;
        std::cout<<a<<" "<<b<<std::endl;
    }
private:
    int a;
    double b;
};

//类模板的偏特化
template<typename T2>
class TemplateClass<int,T2>
{
public:
    TemplateClass(int a,T2 b):a(a),b(b){}

    void show()
    {
        std::cout<<"偏特化class"<<std::endl;
        std::cout<<a<<" "<<b<<std::endl;
    }
private:
    int a;
    double b;
};

//当模板遇上全特化和偏特化
//全特化>偏特化>模板
int main()
{
    // TemplateClass<int,std::string> p(1,"张三");
    TemplateClass<int,double> p(1,1.2);
    p.show();
    return 0;
}